﻿using Rio.Workflow.Runtime;
using System.ServiceModel;

namespace Rio.Workflow.WCF
{
    [ServiceContract]
    public interface IWCFWorkflow
    {
        /// <summary>
        /// Tests this instance.
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string Test();

        /// <summary>
        /// Determines whether the specified message has workflow.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>
        ///   <c>true</c> if the specified context has workflow; otherwise, <c>false</c>.
        /// </returns>
        [OperationContract]
        bool HasWorkflow(CreationContext context);

        /// <summary>
        /// Starts the workflow.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        [OperationContract]
        bool StartWorkflow(CreationContext context);

        /// <summary>
        /// Executes the action.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        [OperationContract]
        ActionResponse ExecuteAction(ActionRequest request);

        /// <summary>
        /// Requests the chrono.
        /// </summary>
        /// <param name="request">The request.</param>
        /// <returns></returns>
        [OperationContract]
        ChronoResponse RequestChrono(ChronoRequest request);

        /// <summary>
        /// Workflow Instance Opened
        /// </summary>
        /// <param name="wkfDefinitionId">The WKF definition id.</param>
        [OperationContract]
        void WorkflowOpened(long wkfDefinitionId);

    }
}